package org.example.controller;


import org.example.pojo.Report;
import org.example.service.IReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * <p>
 * 举报信息表 前端控制器
 * </p>
 *
 * @author zhx
 * @since 2025-01-17
 */
@RestController
@RequestMapping("/report")
public class ReportController {

   @Autowired
    private IReportService reportService;

   @PostMapping("/submitReport")
    public Map<String,Object> submitReport(@RequestBody Report report){
       Map<String,Object> map = new HashMap<>();
       if (reportService.submitReport(report)==1){
           map.put("code",200);
           map.put("msg","举报成功");
       }else {
           map.put("code",500);
           map.put("msg","举报失败");
       }
       return map;
   }
}
